<?php session_start();?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php
require_once "functions.php";
//a session is started
if(isset($_SESSION['lang']))
    require_once "./language_files/generalOptions_" . $_SESSION['lang'] . ".php";
else
    require_once "./language_files/generalOptions_en.php";
if(!isset($_SESSION['member_id']))
    echo "<script type='text/javascript'>top.window.location='index.php';</script>";
//The member ID stored in the session is retrieved
$member_id=$_SESSION['member_id'];

//specifies the connection to the server, as well as the username and password, and opens it
?>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <head>
        <link rel="shortcut icon" type="image/x-icon" href="menu icons/favicon.ico"/>
        <meta http-equiv="X-UA-Compatible" content="IE=9" />
        <link href="style3.css" rel="stylesheet" type="text/css" />
        <?php include 'jquery.php';?>
        <script type="text/javascript" src="functions.js"></script>
        <script type="text/javascript">
            $(document).ready(function(){
                check_top();
            });
        </script>
        <title></title>
    </head>
    <body>
        <!--        The title of the page and some descriptive information is printed-->
        <h1><?php echo $lang['general'];?></h1>
        <h2><?php echo $lang['question'];?></h2>
        <br/>
        <?php
        //a link is created redirecting to the edit information page, passing the memberID as a variable.
        echo '<a href="editInfo.php">' . $lang['edit_1'] . '</a>';
        ?>
        <br/>
        <br/>
        <?php
        //a query is executed, retrieving all the conference records from the database which the logged in user has created
        $memConferences=mysql_query("SELECT conference_id, long_name FROM conference WHERE creator_id = '$member_id'");
        //If the query returns one or more rows,
        if(mysql_num_rows($memConferences) > 0)
        {
            //a descriptive text is printed
            echo'<p style="text-decoration: none">' . $lang['organizer'] . '</p>';
            //a list heading is printed
            echo '<ul>';
            //a loop iterates on all the records returned by the query, and stores them in an associative array.
            while($row=mysql_fetch_array($memConferences,MYSQL_ASSOC))
            {
                $long_name=formatText_safe($row['long_name']);
                //a list item is printed, displaying the conference and a link which enables the user to edit information
                echo '<li>' . $long_name . ' &nbsp&nbsp&nbsp <a href="conferencePage2.php?conference_id=' . $row['conference_id'] . '">' . $lang['edit_2'] . '</a></li>';
            }
            //the list is closed
            echo '</ul>';
        }
        ?>
    </body>
</html>